package com.lanmei.group.weixin.controller.admin;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.jfinal.core.Controller;
import com.jfinal.upload.UploadFile;

public class UploadFileController extends Controller {
	public void uploadImage(){
		Map<String, Object> result = new HashMap<String, Object>();
		UploadFile f = getFile();
		HttpServletRequest request = getRequest();
		String fileserver = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/";
		result.put("msg", "图片上传成功！");
		result.put("state", true);
		result.put("imgurl",fileserver+"upload/"+f.getFileName());
		renderJson(result);
		
	}

}
